package gui.Student;

import javax.swing.JPanel;
import java.awt.SystemColor;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.border.TitledBorder;

import System.MainControl;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ComputerizedExam extends JPanel implements ActionListener{

	/**
	 * 
	 */
	private static final long serialVersionUID = -7360880909879000919L;
	private JTextField textField;
	private JButton btnBack;
	

	/**
	 * Create the panel.
	 */
	public ComputerizedExam() {
		super();
		initialize();
	}
	/**
	 * Create the panel.
	 */
	public void initialize() {
		setBorder(new TitledBorder(null, "Student Main Panel", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		setBackground(SystemColor.activeCaption);
		setBounds(100, 100, 622, 284);
		setLayout(null);
		
		JLabel lblStudentId = new JLabel("Student Id:");
		lblStudentId.setBounds(10, 23, 74, 14);
		add(lblStudentId);
		
		textField = new JTextField();
		textField.setBounds(94, 20, 123, 20);
		add(textField);
		textField.setColumns(10);
		
		JButton btnNewButton = new JButton("Start Exam");
		btnNewButton.setBounds(255, 19, 89, 23);
		add(btnNewButton);
		
		JTextArea textArea = new JTextArea();
		textArea.setBounds(31, 93, 364, 172);
		add(textArea);
		
		JButton btnBack = new JButton("Back");
		btnBack.setFont(MainControl.guiFont);
		btnBack.addActionListener(this);
			
		btnBack.setBounds(443, 232, 89, 23);
		add(btnBack);

	}
	
	@Override			
	public void actionPerformed(ActionEvent e) 
	{
		if(e.getSource() == btnBack)
		{
			MainControl.setGUI(MainControl.currentUser.getRole(), this);
		}
	};
}
